package com.hopool.shop.member;

import java.util.Date;

import org.hibernate.Session;

import com.hopool.shop.BaseTest;

public class MemberTest extends BaseTest{
	
	public void testMemberCRUD(){
		Member mem = new Member();
		mem.setAccount("xiao1");
		mem.setEmail("as@dd.com");
		mem.setMobile("130");
		mem.setPassword("123");
		mem.setRegisterDate(new Date());
		Session s = sf.openSession();
		s.getTransaction().begin();
		
		s.save(mem);
		mem.setEmail("zzh@163.com");
		
		Member mem1 = (Member) s.get(Member.class, mem.getAccount());
		assertEquals("zzh@163.com", mem1.getEmail());
		s.delete(mem);
		
		
		s.getTransaction().commit();
		s.close();
	}
}
